package com.manage.service;

import com.manage.dao.UserDao;
import com.manage.pojo.User;

/**
 * @author 汤奇
 * @version V1.0
 * @Project BookPro
 * @Package com.manage.service
 * @Description:
 * @Date 2022/5/27 12:45
 */
public class UserServiceImpl implements UserService {
    private UserDao userDao;

    public UserServiceImpl(UserDao userDao){
        this.userDao = userDao;
    }

    @Override
    public boolean login(String username, String password) {
        User user = userDao.findUser(username, password);
        //判断用户是否为空
        if (user==null){
            return false;
        }
        return true;
    }

    @Override
    public void register(String username, String password) {
        userDao.addOne(username,password);
    }
}
